package com.ohos.connent.accountcloud.biz.modular.dp.enums;

import com.ohos.connent.accountcloud.common.exception.CommonException;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 审核枚举类
 *
 * @Author: ChenJiaHao
 * @Date: 2024/6/17 17:36
 * @Description:
 */
@Getter
@NoArgsConstructor
public enum CertifiedEnum {

    PENDING_VERIFIED("待审核",0),

    REVIEWED("已审核",1);

    private String value;

    private int status;

    CertifiedEnum(String value, int status) {
        this.value = value;
        this.status = status;
    }

    public static void validate(int status) {
        for (CertifiedEnum item : values()) {
            if (item.status == status) {
                return;
            }
        }
        throw new CommonException("value is invalid");
    }

}
